package com.anxinm.factory.platform;

import com.anxinm.factory.platform.impl.FaDaDaPlatFormHandle;
import com.anxinm.pojo.entity.ContractConfig;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * 平台操作抽象类
 */
public abstract class ContractPlatFormHandle {

    protected ContractConfig config ;

    public void initPlatForm(ContractConfig config){
        this.config = config ;
        /**更新路径资源*/
        Set<String> pathSet = FaDaDaPlatFormHandle.CONTRACT_API_URL_MAP.keySet();
        List<String> collect = new ArrayList<>(pathSet);
        for (String pathKey : collect) {
            FaDaDaPlatFormHandle.CONTRACT_API_URL_MAP.put(pathKey ,config.getUrl() + FaDaDaPlatFormHandle.CONTRACT_API_URL_MAP.get(pathKey)) ;
        }
    }

}
